<%@page language="java" pageEncoding="UTF-8"%>
<%@include file="/template/common/include/top.jsp"%>
<%@include file="/template/common/include/constant.jsp"%>
<script type="text/javascript" src="${pageContext.request.contextPath}/template/js/gftuserfunc.js"></script>
<script language="javascript">
  var eles = [new Ele('id_r_roleName',false,-1,-1,'角色名'),new Ele('id_r_roleDesc',false,-1,-1,'角色描述')];
</script>
<body>
  <div class="main1">当前的位置:角色管理&gt;&gt;角色编辑</div>
  <form method="post" action="${pageContext.request.contextPath}/gftuser.x" id="editFrm">
  ${sys_searchparemeter}
  <input type="hidden" id="id_op" name="op" value="updateRole" />
  <input type="hidden" name="r.id" value="${r.id}" />
  <input type="hidden" id="id_configId" name="configId" />
    <div class="edit_div">
    <table>
      <tr>
        <td>角色名称:</td>
        <td><input type="text" id="id_r_roleName" name="r.roleName" value="${r.roleName}" /></td>
      </tr>
      <tr>
        <td>角色描述:</td>
        <td><input type="text" id="id_r_roleDesc" name="r.roleDesc" value="${r.roleDesc}" /></td>
      </tr>
      <tr>
        <td>角色状态:</td>
        <td>
          <select id="id_r_status" name="r.status">
            <option value="${status_yes}" <c:if test='${r.status == status_yes}'>selected</c:if>>正常</option>
            <option value="${status_no}" <c:if test='${r.status == status_no}'>selected</c:if>>禁用</option>
          </select>
        </td>
      </tr>
    </table>
    <br />
    <table>
      <tr>
        <!--<th width="2%"></th>-->
        <th width="28%">权限名称</th>
        <th width="28%">权限描述</th>
        <th width="28%">权限状态</th>
        <th width="16%">操作</th>
      </tr>
      <c:forEach items="${rights}" var="row">
        <tr>
          <div style="display:none"><input type="checkbox" name="rightid" value="${row.id}" /></div>
          <td>${row.rightName}</td>
          <td>${row.rightDesc}</td>
          <td>
            <c:choose>
              <c:when test='${row.status == status_yes}'>正常</c:when>
              <c:otherwise>禁用</c:otherwise>
            </c:choose>
          </td>
          <td><a href="javascript:commit('editFrm',[['id_op','delRoleRight'],['id_configId','${row.id}']]);" onclick="return confirm('是否要删除此条记录?')"><img src="${pageContext.request.contextPath}/template/images/cz_1.gif" alt="删除" border="0"></a></td>
        </tr>
      </c:forEach>
    </table>
    </div>
    <div class="edit_div">
      <input type="button" onclick="checkForm(eles,'editFrm');" value="确定" class="btn_Submit" />
      <c:if test="${not empty r.id}">
        <input type="button" onclick="selectRights('${r.id}');" value="配置权限" class="btn_Submit" />
      </c:if>
      <input type="button" onclick="commit('editFrm',[['id_op','findRole']]);" value="返回" class="btn_Submit" />
    </div>
  </form>
</body>